package zzps.exeed.web.handle.argument;

import zzps.exeed.kernel.holder.ParameterHolder;
import zzps.exeed.web.Context;

public class SpecialTypeMethodArgumentResolver implements HandlerMethodArgumentResolver{
    @Override
    public boolean support(ParameterHolder parameterHolder) {
        if (Context.class.isAssignableFrom(parameterHolder.getType())){
            return true;
        }
        return false;
    }

    @Override
    public Object resolveArgument(ParameterHolder parameterHolder, Context context) {
        if (Context.class.isAssignableFrom(parameterHolder.getType())){
            return context;
        }
        return null;
    }
}
